diff --git a/rhizome.c b/rhizome.c index f4716e53..43f2d538 100644 --- a/rhizome.c +++ b/rhizome.c @@ -224,15 +224,15 @@ int rhizome_manifest_check_file(rhizome_manifest *m_in) return 0; } if (gotfile) { - DEBUGF("Skipping file checks for bundle, as file is already in the database"); + /* Skipping file checks for bundle, as file is already in the database */ return 0; } /* Find out whether the payload is expected to be encrypted or not */ m_in->payloadEncryption=rhizome_manifest_get_ll(m_in, "crypt"); - /* Check payload file is accessible and discover its length, then check that it matches - the file size stored in the manifest */ + /* Check payload file is accessible and discover its length, then check that it + matches the file size stored in the manifest */ long long mfilesize = rhizome_manifest_get_ll(m_in, "filesize"); m_in->fileLength = 0; if (m_in->dataFileName && m_in->dataFileName[0]) { diff --git a/rhizome_direct_http.c b/rhizome_direct_http.c index ee0e235b..16742f5f 100644 --- a/rhizome_direct_http.c +++ b/rhizome_direct_http.c @@ -35,7 +35,7 @@ int rhizome_direct_clear_temporary_files(rhizome_http_request *r) for(i=0;fields[i];i++) { snprintf(filename,1024,"rhizomedirect.%d.%s",r->alarm.poll.fd,fields[i]); filename[1023]=0; - DEBUGF("Unlinking '%s'",filename); + unlink(filename); } return 0; } @@ -178,13 +178,13 @@ int rhizome_direct_form_received(rhizome_http_request *r) if (strcmp(inet_ntoa(r->requestor.sin_addr), confValueGet("rhizome.api.addfile.allowedaddress","127.0.0.1"))) { - DEBUGF("Request was from %s, but is only allowed from %s", + DEBUGF("rhizome.api.addfile request received from %s, but is only allowed from %s", inet_ntoa(r->requestor.sin_addr), confValueGet("rhizome.api.addfile.allowedaddress", "127.0.0.1")); rhizome_direct_clear_temporary_files(r); - return rhizome_server_simple_http_response(r,400,"Not available from here."); + return rhizome_server_simple_http_response(r,404,"Not available from here."); } switch(r->fields_seen) { @@ -250,7 +250,6 @@ int rhizome_direct_form_received(rhizome_http_request *r) } else { if (debug & DEBUG_RHIZOME) DEBUGF("manifest contains name=\"%s\"", name); } - DEBUGF("File name = '%s'",name); const char *senderhex = rhizome_manifest_get(m, "sender", NULL, 0); @@ -378,8 +377,6 @@ int rhizome_direct_process_mime_line(rhizome_http_request *r,char *buffer,int co int blankLine=0; if (!strcmp(buffer,"\r\n")) blankLine=1; - DEBUGF("mime state 0x%x, blankLine=%d, boundary=%d, EOF=%d, bytes=%d", - r->source_flags,blankLine,boundaryLine,endOfForm,count); switch(r->source_flags) { case RD_MIME_STATE_INITIAL: if (boundaryLine) r->source_flags=RD_MIME_STATE_PARTHEADERS; @@ -387,7 +384,6 @@ int rhizome_direct_process_mime_line(rhizome_http_request *r,char *buffer,int co case RD_MIME_STATE_PARTHEADERS: case RD_MIME_STATE_MANIFESTHEADERS: case RD_MIME_STATE_DATAHEADERS: - DEBUGF("mime line %s", alloca_str_toprint(r->request)); if (blankLine) { /* End of headers */ if (r->source_flags==RD_MIME_STATE_PARTHEADERS) @@ -415,7 +411,6 @@ int rhizome_direct_process_mime_line(rhizome_http_request *r,char *buffer,int co } snprintf(filename,1024,"rhizomedirect.%d.%s",r->alarm.poll.fd,field); filename[1023]=0; - DEBUGF("Writing to '%s'",filename); r->field_file=fopen(filename,"w"); if (!r->field_file) { rhizome_direct_clear_temporary_files(r); @@ -438,7 +433,6 @@ int rhizome_direct_process_mime_line(rhizome_http_request *r,char *buffer,int co (r, 400, "