]> Chaos Git - corbenik/ctrulib.git/commitdiff
Define the known KeepAlive on/off flag
authorKen Sanislo <ken@intherack.com>
Tue, 26 Jul 2016 19:39:16 +0000 (12:39 -0700)
committerKen Sanislo <ken@intherack.com>
Tue, 26 Jul 2016 19:39:16 +0000 (12:39 -0700)
libctru/include/3ds/services/httpc.h
libctru/source/services/httpc.c

index f6a41f9841b03bd7d3838c61b07e6d37fa2f90b5..1f95dcfc19fb39eed909739854a008859aca263d 100644 (file)
@@ -25,6 +25,12 @@ typedef enum {
        HTTPC_STATUS_DOWNLOAD_READY = 0x7       ///< Download ready.
 } HTTPC_RequestStatus;
 
+/// HTTP KeepAlive option.
+typedef enum {
+       HTTPC_KEEPALIVE_DISABLED = 0x0,
+       HTTPC_KEEPALIVE_ENABLED = 0x1
+} HTTPC_KeepAlive;
+
 /// Result code returned when a download is pending.
 #define HTTPC_RESULTCODE_DOWNLOADPENDING 0xd840a02b
 
@@ -254,8 +260,8 @@ Result httpcDownloadData(httpcContext *context, u8* buffer, u32 size, u32 *downl
 
 /**
  * @brief Sets Keep-Alive for the context.
- * @param context Context to set flags on.
- * @param options Keep-Alive option flags.
+ * @param context Context to set the KeepAlive flag on.
+ * @param option HTTPC_KeepAlive option.
  */
-Result httpcSetKeepAlive(httpcContext *context, u32 options);
+Result httpcSetKeepAlive(httpcContext *context, HTTPC_KeepAlive option);
 
index d216a059567e7838cf5d6aa13379e1bbecaaa879..c4bc3d9a1e487a4a2575d823b8d406243bc951c1 100644 (file)
@@ -650,13 +650,13 @@ Result httpcCloseClientCertContext(u32 ClientCert_contexthandle)
        return cmdbuf[1];
 }
 
-Result httpcSetKeepAlive(httpcContext *context, u32 options)
+Result httpcSetKeepAlive(httpcContext *context, HTTPC_KeepAlive option)
 {
        u32* cmdbuf=getThreadCommandBuffer();
 
        cmdbuf[0]=IPC_MakeHeader(0x37,2,0); // 0x370080
        cmdbuf[1]=context->httphandle;
-       cmdbuf[2]=options;
+       cmdbuf[2]=option;
 
        Result ret=0;
        if(R_FAILED(ret=svcSendSyncRequest(context->servhandle)))return ret;