fix stuff

git-svn-id: file:///raid/svn-personal/okuu/trunk@7 7d206d2a-66c2-044b-96de-ba755a9b3ba8
This commit is contained in:
Nishi 2024-09-11 00:40:20 +00:00
parent 32122a996c
commit 812c58d2c1
2 changed files with 9 additions and 5 deletions

View File

@ -159,6 +159,7 @@ void ok_bot(void){
char* msg = ok_strcat(temp, line);
ircfw_socket_send_cmd(ok_sock, NULL, msg);
free(msg);
usleep(1000 * 100); /* Sleep for 100ms */
}
free(line);
@ -176,10 +177,12 @@ void ok_bot(void){
count = atoi(list[i - 1]->d_name) + 1;
free(list);
}
f = fopen(nntpcount, "wb");
if(f != NULL){
fwrite(&count, sizeof(count), 1, f);
fclose(f);
if(sendable){
f = fopen(nntpcount, "wb");
if(f != NULL){
fwrite(&count, sizeof(count), 1, f);
fclose(f);
}
}
continue;
}

View File

@ -286,6 +286,7 @@ int ok_news_write(const char* nick, const char* message){
if(nntppass != NULL){
sprintf(construct, "AUTHINFO PASS %s\r\n", nntppass);
send(nt_sock, construct, strlen(construct), 0);
sta = ok_news_parse(nt_sock);
if(sta != 281){
goto cleanup;
}
@ -300,7 +301,7 @@ int ok_news_write(const char* nick, const char* message){
send(nt_sock, construct, strlen(construct), 0);
sprintf(construct, "Newsgroups: %s\r\n", nntpgroup);
send(nt_sock, construct, strlen(construct), 0);
sprintf(construct, "Subject: Message from %s\r\n", nick);
sprintf(construct, "Subject: [IRC] Message from %s\r\n", nick);
send(nt_sock, construct, strlen(construct), 0);
send(nt_sock, "\r\n", 2, 0);
char c;