771 } else if(S_ISDIR(s.st_mode)) { |
771 } else if(S_ISDIR(s.st_mode)) { |
772 // PUT on collections is not allowed |
772 // PUT on collections is not allowed |
773 protocol_status(sn, rq, PROTOCOL_METHOD_NOT_ALLOWED, NULL); |
773 protocol_status(sn, rq, PROTOCOL_METHOD_NOT_ALLOWED, NULL); |
774 return REQ_ABORTED; |
774 return REQ_ABORTED; |
775 } |
775 } |
|
776 vfs->error_response_set = FALSE; // reset error |
776 |
777 |
777 SYS_FILE fd = vfs_open(vfs, path, O_WRONLY | O_TRUNC | create_file); |
778 SYS_FILE fd = vfs_open(vfs, path, O_WRONLY | O_TRUNC | create_file); |
778 if(!fd) { |
779 if(!fd) { |
779 // if it fails, vfs_open sets http status code |
780 // if it fails, vfs_open sets http status code |
780 return REQ_ABORTED; |
781 return REQ_ABORTED; |