Browse Source

Merge pull request #196 from majestrate/master

patch for nntpchan stream
pull/40/head
Marcin Łabanowski 8 years ago
committed by GitHub
parent
commit
fc21854770
  1. 5
      inc/nntpchan/nntpchan.php

5
inc/nntpchan/nntpchan.php

@ -64,7 +64,9 @@ function gen_nntp($headers, $files) {
} }
function nntp_publish($msg, $id) { function nntp_publish($msg, $id) {
$s = fsockopen("tcp://localhost:1119"); global $config;
$server = $config["nntpchan"]["server"];
$s = fsockopen("tcp://$server");
fgets($s); fgets($s);
fputs($s, "MODE STREAM\r\n"); fputs($s, "MODE STREAM\r\n");
fgets($s); fgets($s);
@ -72,6 +74,7 @@ function nntp_publish($msg, $id) {
fputs($s, $msg); fputs($s, $msg);
fputs($s, "\r\n.\r\n"); fputs($s, "\r\n.\r\n");
fgets($s); fgets($s);
fputs($s, "QUIT\r\n");
fclose($s); fclose($s);
} }

Loading…
Cancel
Save