Bugzilla – Attachment 189829 Details for
Bug 41271
pod_coverage.t unintentionally attempts to launch a SIP server when checking SIPServer.pm
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 41271: Fix pod_coverage for SIPServer.pm
e2f2a35.patch (text/plain), 4.77 KB, created by
Jonathan Druart
on 2025-11-21 08:47:07 UTC
(
hide
)
Description:
Bug 41271: Fix pod_coverage for SIPServer.pm
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2025-11-21 08:47:07 UTC
Size:
4.77 KB
patch
obsolete
>From e2f2a351909f55ad5ae4db8323e0a420f5a0ab1b Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pedro.amorim@openfifth.co.uk> >Date: Thu, 20 Nov 2025 15:54:44 +0000 >Subject: [PATCH] Bug 41271: Fix pod_coverage for SIPServer.pm > >Because the file is now being properly checked for pod_coverage, it fails (because a lot of methods dont have pod coverage. Add here > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > C4/SIP/SIPServer.pm | 92 +++++++++++++++++++++++++++++++++++++-------- > 1 file changed, 76 insertions(+), 16 deletions(-) > >diff --git a/C4/SIP/SIPServer.pm b/C4/SIP/SIPServer.pm >index 4cccd670af9..cd407fda738 100644 >--- a/C4/SIP/SIPServer.pm >+++ b/C4/SIP/SIPServer.pm >@@ -243,8 +243,12 @@ sub _config_up_to_date { > # Child > # > >-# process_request is the callback used by Net::Server to handle >-# an incoming connection request. >+=head2 process_request >+ >+process_request is the callback used by Net::Server to handle >+an incoming connection request. >+ >+=cut > > sub process_request { > my $self = shift; >@@ -304,6 +308,15 @@ sub process_request { > # Transports > # > >+=head2 raw_transport >+ >+Manages the SIP login process for raw TCP connections. Clears any >+previous session state, applies a timeout, reads the initial request, >+and authenticates it. On success, sets up logging context and enters >+the SIP protocol loop. Returns on EOF, timeout, or failed login. >+ >+=cut >+ > sub raw_transport { > my $self = shift; > my $input; >@@ -365,6 +378,15 @@ sub raw_transport { > return; > } > >+=head2 get_clean_string >+ >+Cleans a string by removing leading and trailing non-alphanumeric >+characters. Logs the string before and after cleaning, or notes if >+the input was undefined. Returns the cleaned string (or undef if no >+string was provided). >+ >+=cut >+ > sub get_clean_string { > my $string = shift; > if ( defined $string ) { >@@ -379,6 +401,14 @@ sub get_clean_string { > return $string; > } > >+=head2 get_clean_input >+ >+Reads a single line from STDIN, normalizes it using >+C<get_clean_string>, and discards any additional input lines, logging >+them as errors. Returns the cleaned input line. >+ >+=cut >+ > sub get_clean_input { > local $/ = "\012"; > my $in = <STDIN>; >@@ -389,6 +419,17 @@ sub get_clean_input { > return $in; > } > >+=head2 telnet_transport >+ >+Handles the login process for terminals connecting via the telnet >+transport. Prompts for a username and password, applies a timeout to >+protect against hung connections, and validates the credentials against >+configured accounts. On successful authentication, initializes the SIP >+session by invoking C<sip_protocol_loop>. Dies on timeout or repeated >+failed login attempts. >+ >+=cut >+ > sub telnet_transport { > my $self = shift; > my ( $uid, $pwd ); >@@ -452,11 +493,15 @@ sub telnet_transport { > return; > } > >-# >-# The terminal has logged in, using either the SIP login process >-# over a raw socket, or via the pseudo-unix login provided by the >-# telnet transport. From that point on, both the raw and the telnet >-# processes are the same: >+=head2 sip_protocol_loop >+ >+The terminal has logged in, using either the SIP login process >+over a raw socket, or via the pseudo-unix login provided by the >+telnet transport. From that point on, both the raw and the telnet >+processes are the same: >+ >+=cut >+ > sub sip_protocol_loop { > my $self = shift; > my $service = $self->{service}; >@@ -514,6 +559,16 @@ sub sip_protocol_loop { > return; > } > >+=head2 read_request >+ >+Reads a single SIP request line from STDIN using carriage return as the >+record separator. Strips leading and trailing non-alphanumeric >+characters, removes extra line breaks, and logs any trimming that >+occurs. Also flushes Level-1 caches before processing each request. >+Returns the cleaned request string, or undef on EOF. >+ >+=cut >+ > sub read_request { > my $raw_length; > local $/ = "\015"; >@@ -552,15 +607,20 @@ sub read_request { > return $buffer; > } > >-# $server->get_timeout({ $type => 1, fallback => $fallback }); >-# where $type is transport | client | policy >-# >-# Centralizes all timeout logic. >-# Transport refers to login process, client to active connections. >-# Policy timeout is transaction timeout (used in ACS status message). >-# >-# Fallback is optional. If you do not pass transport, client or policy, >-# you will get fallback or hardcoded default. >+=head2 get_timeout >+ >+ $server->get_timeout({ $type => 1, fallback => $fallback }); >+ >+where $type is transport | client | policy >+ >+Centralizes all timeout logic. >+Transport refers to login process, client to active connections. >+Policy timeout is transaction timeout (used in ACS status message). >+ >+Fallback is optional. If you do not pass transport, client or policy, >+you will get fallback or hardcoded default. >+ >+=cut > > sub get_timeout { > my ( $server, $params ) = @_; >-- >2.43.0 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 41271
:
189713
|
189797
|
189798
|
189799
|
189828
| 189829 |
189830