From 4d666662027efdcca0ab0f5572da65d477e5ed5b Mon Sep 17 00:00:00 2001
From: zzz <zzz@i2pmail.org>
Date: Sun, 1 Oct 2023 07:10:44 -0400
Subject: [PATCH] SAM: Add section on accept errors

ref: Gitlab i2p.i2p #399
---
 i2p2www/pages/site/docs/api/samv3.html | 24 ++++++++++++++++++++++--
 1 file changed, 22 insertions(+), 2 deletions(-)

diff --git a/i2p2www/pages/site/docs/api/samv3.html b/i2p2www/pages/site/docs/api/samv3.html
index d9fc7a9ef..843496430 100644
--- a/i2p2www/pages/site/docs/api/samv3.html
+++ b/i2p2www/pages/site/docs/api/samv3.html
@@ -1,7 +1,7 @@
 {% extends "global/layout.html" %}
 {% block title %}SAM V3{% endblock %}
-{% block lastupdated %}2023-01{% endblock %}
-{% block accuratefor %}API 0.9.57{% endblock %}
+{% block lastupdated %}2023-10{% endblock %}
+{% block accuratefor %}API 0.9.59{% endblock %}
 {% block content %}
 <p>SAM is a simple client protocol for interacting with I2P.
 SAM is the recommended protocol for non-Java applications to connect to the I2P network,
@@ -944,6 +944,26 @@ passing through the current socket is forwarded from and to the connected
 I2P destination peer, until one of the peer closes the socket.
 </p>
 
+<h4>Errors After OK</h4>
+<p>
+In rare cases, the SAM bridge may encounter an error after sending RESULT=OK,
+but before a connection comes in and sending the $destination line to the client.
+These errors may include router shutdown, router restart, and session close.
+In these cases, when SILENT=false, the SAM bridge may, but is not required to
+(implementation-dependent), send the line:
+
+<pre>
+&lt;-  STREAM STATUS
+         RESULT=I2P_ERROR
+         [MESSAGE=...]
+</pre>
+
+before immediately closing the socket. This line is not, of course, decodable as a
+valid Base 64 destination.
+</p>
+
+
+
 <h3>SAM Virtual Streams : FORWARD</h3>
 <p>
 A client can use a regular socket server and wait for connection requests
-- 
GitLab