Diff of /osoft.c [fecfe9] .. [6b0857]  Maximize  Restore

Switch to side-by-side view

--- a/osoft.c
+++ b/osoft.c
@@ -1132,7 +1132,7 @@
  *  Handle a new firmware
  */
 
-void handleFileUpload(char* path) {
+void handleFileUpload() {
 
 	
     cgiFilePtr file;
@@ -1149,6 +1149,7 @@
     buffer=malloc(BufferLen);
     if(!buffer) goto FAIL;
 
+//fprintf(stderr,"entered handleFileUpload\n");
     cgiHeaderContentType("text/html");
     //now retrieve the value of the "file" attribute,it should be the file path on the client machine
     if (cgiFormFileName("updatefile", name, sizeof(name)) !=cgiFormSuccess) {
@@ -1212,10 +1213,11 @@
 	char *request_method;
 
 	 
-	cgivars = getcgivars();
+
 	request_method= getenv("REQUEST_METHOD") ;
 	
 	if((0!=strcmp(request_method, "GET"))&&(0!=strcmp(request_method, "POST"))){
+		cgivars = getcgivars();
 		if (cgivars[0] == 0) {
 			readSettingsFromFile(cfg, setting, settings);
 		}
@@ -1223,6 +1225,9 @@
 	
 	
 	if (0==strcmp(request_method, "GET")) {
+
+		cgivars = getcgivars();
+		
 		if (cgivars[0] == 0) {
 			readSettingsFromFile(cfg, setting, settings);
 		}
@@ -1266,7 +1271,7 @@
         {
 		
 		
-		handleFileUpload(cgivars[3]);
+		handleFileUpload();
 		readSettingsFromFile(cfg, setting, settings);
 	} 
 

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks