Compare commits

...

2 Commits

Author SHA1 Message Date
coah
52d36a1840 match(NHTTP_thread): NHTTPi_RecvProxyConnectHeader init order
Set cursor/index before ended so MWCC emits li r4 then li r5.
2026-10-01 17:08:22 -05:00
coah
feb7ba400d cleanup(Contest): rename NHTTP callback error; drop dead locals (#504)
param_1 → error in sNHTTPReqCallback; remove unused Ghidra locals
from IPLContestInitialize.
2026-10-01 17:07:39 -05:00
2 changed files with 5 additions and 11 deletions

View File

@@ -371,9 +371,9 @@ static BOOL NHTTPi_RecvProxyConnectHeader(NHTTPThreadContext* context)
response->httpStatus = NHTTPi_strToInt(header + 9, 3);
if (NHTTPi_strnicmp(header, "HTTP/", 5) == 0 && header[8] == ' '
&& response->httpStatus == 200) accepted = TRUE;
ended = FALSE;
cursor = header;
index = 0;
ended = FALSE;
while (index < used)
{
if (index > 1 && cursor[-1] == '\r' && *cursor == '\r') ended = TRUE;

View File

@@ -53,16 +53,10 @@ void iplContest_813D54F8(BOOL success, NAT nat);
void* IPLContestAlloc(int size);
void IPLContestFree(void* block, u32 _unused);
void sNHTTPReqCallback(int param_1, NHTTPResponse* httpRes);
void sNHTTPReqCallback(int error, NHTTPResponse* httpRes);
void sNHTTPCleanupCallback();
void IPLContestInitialize(void* heapBuf, NCDProxyProfile* proxy) {
char* pcVar1;
char cVar2;
char* pcVar3;
char* pcVar4;
int iVar5;
g_session.heapBuf = heapBuf;
g_session.heap = MEMCreateExpHeapEx(heapBuf, 0x10000, 0);
OSInitMutex(&g_session.mutex);
@@ -416,9 +410,9 @@ void IPLContestFree(void* block, u32 _unused) {
OSUnlockMutex(&g_session.mutex);
}
void sNHTTPReqCallback(int param_1, NHTTPResponse* httpRes) {
void sNHTTPReqCallback(int error, NHTTPResponse* httpRes) {
g_session.httpResponse = httpRes;
if (param_1 == 0) {
if (error == 0) {
switch (NHTTPGetResultCode(httpRes)) {
case 200: {
g_session.httpTestState = HTTP_TEST_RESPONSE_RECEIVED;
@@ -440,7 +434,7 @@ void sNHTTPReqCallback(int param_1, NHTTPResponse* httpRes) {
}
g_session.httpTestState = HTTP_TEST_RESPONSE_ERRORED;
switch (param_1) {
switch (error) {
case 0x4: {
g_session.errCode = g_session.errCode != 0 ? g_session.errCode : -52100;
break;