Explicitly set the write mode to be false for ANN FileTransfer.
authorDavid Teirney <david@teirney.net>
Wed, 2 May 2012 08:06:53 +0000 (20:06 +1200)
committerDavid Teirney <david@teirney.net>
Sun, 6 May 2012 06:04:38 +0000 (18:04 +1200)
lib/cmyth/libcmyth/connection.c

index 34afb52..9d13721 100644 (file)
@@ -536,7 +536,7 @@ cmyth_conn_connect_file(cmyth_proginfo_t prog,  cmyth_conn_t control,
        int err = 0;
        int count = 0;
        int r;
-       int ann_size = sizeof("ANN FileTransfer []:[][]:[]");
+       int ann_size = sizeof("ANN FileTransfer 0[]:[][]:[]");
        cmyth_file_t ret = NULL;
 
        if (!prog) {
@@ -599,7 +599,7 @@ cmyth_conn_connect_file(cmyth_proginfo_t prog,  cmyth_conn_t control,
                goto shut;
        }
        if (control->conn_version >= 44) {
-               sprintf(announcement, "ANN FileTransfer %s[]:[]%s[]:[]",
+               sprintf(announcement, "ANN FileTransfer %s 0[]:[]%s[]:[]", // write = false
                          my_hostname, prog->proginfo_pathname);
        }
        else {
@@ -698,7 +698,7 @@ cmyth_conn_connect_path(char* path, cmyth_conn_t control,
        int err = 0;
        int count = 0;
        int r, port;
-       int ann_size = sizeof("ANN FileTransfer []:[][]:[]");
+       int ann_size = sizeof("ANN FileTransfer 0[]:[][]:[]");
        struct sockaddr_in addr;
         socklen_t addr_size = sizeof(addr);
        cmyth_file_t ret = NULL;
@@ -746,7 +746,7 @@ cmyth_conn_connect_path(char* path, cmyth_conn_t control,
                goto shut;
        }
        if (control->conn_version >= 44) {
-               sprintf(announcement, "ANN FileTransfer %s[]:[]%s[]:[]",
+               sprintf(announcement, "ANN FileTransfer %s 0[]:[]%s[]:[]",  // write = false
                          my_hostname, path);
        }
        else {