Finally added code to exit httpc properly via HTTPC_Finalize.
This commit is contained in:
parent
e2852d14f1
commit
049d2e2373
@ -139,6 +139,12 @@ Result httpcDownloadData(httpcContext *context, u8* buffer, u32 size, u32 *downl
|
|||||||
*/
|
*/
|
||||||
Result HTTPC_Initialize(Handle handle, u32 sharedmem_size, Handle sharedmem_handle);
|
Result HTTPC_Initialize(Handle handle, u32 sharedmem_size, Handle sharedmem_handle);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Finalizes HTTPC.
|
||||||
|
* @param handle HTTPC service handle to use.
|
||||||
|
*/
|
||||||
|
Result HTTPC_Finalize(Handle handle);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Initializes a HTTP connection session.
|
* @brief Initializes a HTTP connection session.
|
||||||
* @param handle HTTPC service handle to use.
|
* @param handle HTTPC service handle to use.
|
||||||
|
@ -61,6 +61,9 @@ Result httpcInit(u32 sharedmem_size)
|
|||||||
void httpcExit(void)
|
void httpcExit(void)
|
||||||
{
|
{
|
||||||
if (AtomicDecrement(&__httpc_refcount)) return;
|
if (AtomicDecrement(&__httpc_refcount)) return;
|
||||||
|
|
||||||
|
HTTPC_Finalize(__httpc_servhandle);
|
||||||
|
|
||||||
svcCloseHandle(__httpc_servhandle);
|
svcCloseHandle(__httpc_servhandle);
|
||||||
|
|
||||||
if(__httpc_sharedmem_handle)
|
if(__httpc_sharedmem_handle)
|
||||||
@ -207,6 +210,18 @@ Result HTTPC_Initialize(Handle handle, u32 sharedmem_size, Handle sharedmem_hand
|
|||||||
return cmdbuf[1];
|
return cmdbuf[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Result HTTPC_Finalize(Handle handle)
|
||||||
|
{
|
||||||
|
u32* cmdbuf=getThreadCommandBuffer();
|
||||||
|
|
||||||
|
cmdbuf[0]=IPC_MakeHeader(0x39,0,0); // 0x390000
|
||||||
|
|
||||||
|
Result ret=0;
|
||||||
|
if(R_FAILED(ret=svcSendSyncRequest(handle)))return ret;
|
||||||
|
|
||||||
|
return cmdbuf[1];
|
||||||
|
}
|
||||||
|
|
||||||
Result HTTPC_CreateContext(Handle handle, HTTPC_RequestMethod method, char* url, Handle* contextHandle)
|
Result HTTPC_CreateContext(Handle handle, HTTPC_RequestMethod method, char* url, Handle* contextHandle)
|
||||||
{
|
{
|
||||||
u32* cmdbuf=getThreadCommandBuffer();
|
u32* cmdbuf=getThreadCommandBuffer();
|
||||||
|
Loading…
Reference in New Issue
Block a user