]> Chaos Git - corbenik/ctrulib.git/commitdiff
Add httpcSetKeepAlive() to turn HTTP Keep-Alive on and off
authorKen Sanislo <ken@intherack.com>
Tue, 26 Jul 2016 17:47:33 +0000 (10:47 -0700)
committerKen Sanislo <ken@intherack.com>
Tue, 26 Jul 2016 17:47:33 +0000 (10:47 -0700)
libctru/include/3ds/services/httpc.h
libctru/source/services/httpc.c

index 63acf80aa0433f5984304aba5ec29cfc062239ab..f6a41f9841b03bd7d3838c61b07e6d37fa2f90b5 100644 (file)
@@ -252,3 +252,10 @@ Result httpcCloseClientCertContext(u32 ClientCert_contexthandle);
  */
 Result httpcDownloadData(httpcContext *context, u8* buffer, u32 size, u32 *downloadedsize);
 
+/**
+ * @brief Sets Keep-Alive for the context.
+ * @param context Context to set flags on.
+ * @param options Keep-Alive option flags.
+ */
+Result httpcSetKeepAlive(httpcContext *context, u32 options);
+
index 3490751a80489a1fd564fea08ca122ae96106125..d216a059567e7838cf5d6aa13379e1bbecaaa879 100644 (file)
@@ -649,3 +649,17 @@ Result httpcCloseClientCertContext(u32 ClientCert_contexthandle)
 
        return cmdbuf[1];
 }
+
+Result httpcSetKeepAlive(httpcContext *context, u32 options)
+{
+       u32* cmdbuf=getThreadCommandBuffer();
+
+       cmdbuf[0]=IPC_MakeHeader(0x37,2,0); // 0x370080
+       cmdbuf[1]=context->httphandle;
+       cmdbuf[2]=options;
+
+       Result ret=0;
+       if(R_FAILED(ret=svcSendSyncRequest(context->servhandle)))return ret;
+
+       return cmdbuf[1];
+}