diff --git a/http_intf.c b/http_intf.c index dacbbd0c71..a8b7e6eec1 100644 --- a/http_intf.c +++ b/http_intf.c @@ -87,13 +87,13 @@ int http_intf_command(unsigned mode, char *url) case HTTP_INTF_GET: /* *** GET *** */ ret = http_get(filename, &data, &lg, typebuf); - RARCH_LOG("res=%d,type='%s',lg=%d\n", ret, typebuf, lg); + RARCH_LOG("res=%d, type='%s', lg=%d\n", ret, typebuf, lg); fwrite(data, lg, 1, stdout); break; case HTTP_INTF_HEAD: /* *** HEAD *** */ ret = http_head(filename, &lg, typebuf); - RARCH_LOG("res=%d,type='%s',lg=%d\n",ret, typebuf, lg); + RARCH_LOG("res=%d, type='%s', lg=%d\n",ret, typebuf, lg); break; case HTTP_INTF_DELETE: /* *** DELETE *** */ @@ -102,7 +102,7 @@ int http_intf_command(unsigned mode, char *url) break; /* impossible... */ default: - RARCH_LOG("impossible mode value=%d\n", mode); + RARCH_LOG("Impossible mode value=%d\n", mode); return 5; } if (data) @@ -112,8 +112,10 @@ int http_intf_command(unsigned mode, char *url) if (proxy) free(http_proxy_server); + /* Resource successfully created? */ if (ret == 200) return 0; + /* Resource successfully read? */ if (ret == 201) return 0; return ret; diff --git a/http_lib.h b/http_lib.h index 5272369086..1221571be4 100644 --- a/http_lib.h +++ b/http_lib.h @@ -34,15 +34,15 @@ typedef enum { ERRWRDT=-5, /* Write error on socket while writing data */ ERRRDHD=-6, /* Read error on socket while reading result */ ERRPAHD=-7, /* Invalid answer from data server */ - ERRNULL=-8, /* Null data pointer */ + ERRNULL=-8, /* NULL data pointer */ ERRNOLG=-9, /* No/Bad length in header */ ERRMEM=-10, /* Can't allocate memory */ ERRRDDT=-11,/* Read error while reading data */ - ERRURLH=-12,/* Invalid url - must start with 'http://' */ - ERRURLP=-13,/* Invalid port in url */ + ERRURLH=-12,/* Invalid URL - must start with 'http://' */ + ERRURLP=-13,/* Invalid port in URL */ - /* Return code by the server */ + ERR400=400, /* Invalid query */ ERR403=403, /* Forbidden */ ERR408=408, /* Request timeout */ @@ -51,9 +51,9 @@ typedef enum { ERR503=503, /* Service overloaded */ /* Succesful results */ - OK0 = 0, /* successfull parse */ - OK201=201, /* Ressource succesfully created */ - OK200=200 /* Ressource succesfully read */ + OK0 = 0, /* successfully parsed */ + OK201=201, /* Resource succesfully created */ + OK200=200 /* Resource succesfully read */ } http_retcode;