mirror of the now-defunct rocklinux.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

57 lines
1.6 KiB

diff -pruN ircp-0.3/src/ircp.c ircp-0.3_patch/src/ircp.c
--- ircp-0.3/src/ircp.c 2002-12-01 18:34:41.000000000 +0100
+++ ircp-0.3_patch/src/ircp.c 2004-05-27 10:23:01.008095904 +0200
@@ -72,10 +72,15 @@ int main(int argc, char *argv[])
return -1;
}
- if(argc >= 3)
+ if(argc >= 3){
+ downloadpath = (char *)malloc(strlen(argv[2]+1));
+ sprintf(downloadpath, "%s", argv[2]);
inbox = argv[2];
- else
+ } else {
+ downloadpath = (char *)malloc(2);
+ sprintf(downloadpath, ".");
inbox = ".";
+ }
ircp_srv_recv(srv, inbox);
#ifdef DEBUG_TCP
diff -pruN ircp-0.3/src/ircp.h ircp-0.3_patch/src/ircp.h
--- ircp-0.3/src/ircp.h 2002-12-01 18:34:41.000000000 +0100
+++ ircp-0.3_patch/src/ircp.h 2004-05-27 10:21:24.422779104 +0200
@@ -22,6 +22,8 @@ enum {
IRCP_EV_RECEIVING,
};
+char *downloadpath;
+
/* Number of bytes passed at one time to OBEX */
#define STREAM_CHUNK 4096
diff -pruN ircp-0.3/src/ircp_server.c ircp-0.3_patch/src/ircp_server.c
--- ircp-0.3/src/ircp_server.c 2002-12-01 18:34:41.000000000 +0100
+++ ircp-0.3_patch/src/ircp_server.c 2004-05-27 10:22:44.161656952 +0200
@@ -223,15 +223,19 @@ static int new_file(ircp_server_t *srv,
}
}
if(name == NULL) {
+#if 0
DEBUG(0, "Got a PUT without a name. Refusing\n");
/* Send back error */
OBEX_ObjectSetRsp(object, OBEX_RSP_BAD_REQUEST, OBEX_RSP_BAD_REQUEST);
srv->infocb(IRCP_EV_ERR, "");
goto out;
+#endif
+ name=(char *)malloc(28);
+ sprintf(name, "ircp_receive_i_have_no_name");
}
srv->infocb(IRCP_EV_RECEIVING, name);
- srv->fd = ircp_open_safe("", name);
+ srv->fd = ircp_open_safe(downloadpath, name);
ret = srv->fd;