<div dir="ltr"><div><div><div>Hi Brian,<br><br></div>Yes, filing a bug is the best idea.<br><br></div>Cheers,<br></div>- Ira<br><br></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature"><div dir="ltr">Ira McDonald (Musician / Software Architect)<br>Co-Chair - TCG Trusted Mobility Solutions WG<br>Chair - Linux Foundation Open Printing WG<br>Secretary - IEEE-ISTO Printer Working Group<br>Co-Chair - IEEE-ISTO PWG Internet Printing Protocol WG<br>IETF Designated Expert - IPP &amp; Printer MIB<br>Blue Roof Music / High North Inc<br><a style="color:rgb(51,51,255)" href="http://sites.google.com/site/blueroofmusic" target="_blank">http://sites.google.com/site/blueroofmusic</a><br><a style="color:rgb(102,0,204)" href="http://sites.google.com/site/highnorthinc" target="_blank">http://sites.google.com/site/highnorthinc</a><br>mailto: <a href="mailto:blueroofmusic@gmail.com" target="_blank">blueroofmusic@gmail.com</a><br>Winter  579 Park Place  Saline, MI  48176  734-944-0094<br>Summer  PO Box 221  Grand Marais, MI 49839  906-494-2434<br><br><div style="display:inline"></div><div style="display:inline"></div><div style="display:inline"></div><div></div><div></div><div></div><div></div></div></div></div>
<br><div class="gmail_quote">On Mon, Apr 11, 2016 at 12:51 PM, Brian Norris <span dir="ltr">&lt;<a href="mailto:computersforpeace@gmail.com" target="_blank">computersforpeace@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Ping? Should I just file a bug for these sort of questions?<br>
<div class="HOEnZb"><div class="h5"><br>
On Tue, Mar 22, 2016 at 01:40:34PM -0700, Brian Norris wrote:<br>
&gt; Hi,<br>
&gt;<br>
&gt; I&#39;m looking at the features of cups-browsed to see if I would want to<br>
&gt; use it for my purposes, and I ran across a really confusing piece of<br>
&gt; logic in the source code:<br>
&gt;<br>
&gt;     if (!pdl || pdl[0] == &#39;\0&#39; ||<br>
&gt;         (!strcasestr(pdl, &quot;application/postscript&quot;) &amp;&amp;<br>
&gt;          !strcasestr(pdl, &quot;application/pdf&quot;) &amp;&amp;<br>
&gt;          !strcasestr(pdl, &quot;image/pwg-raster&quot;) &amp;&amp;<br>
&gt;          ((!strcasestr(pdl, &quot;application/vnd.hp-PCL&quot;) &amp;&amp;<br>
&gt;            !strcasestr(pdl, &quot;application/PCL&quot;) &amp;&amp;<br>
&gt;            !strcasestr(pdl, &quot;application/x-pcl&quot;)) ||<br>
&gt;           ((strncasecmp(make_model, &quot;HP&quot;, 2) ||<br>
&gt;             strncasecmp(make_model, &quot;Hewlett Packard&quot;, 15) ||<br>
&gt;             strncasecmp(make_model, &quot;Hewlett-Packard&quot;, 15)) &amp;&amp;<br>
&gt;            !strcasestr(make_model, &quot;LaserJet&quot;) &amp;&amp;<br>
&gt;            !strcasestr(make_model, &quot;Mopier&quot;))) &amp;&amp;<br>
&gt;          !strcasestr(pdl, &quot;application/vnd.hp-PCLXL&quot;))) {<br>
&gt;       debug_printf(&quot;cups-browsed: Cannot create remote printer %s (%s) as its PDLs are not known, ignoring this printer.\n&quot;,<br>
&gt;                    p-&gt;name, p-&gt;uri);<br>
&gt;       goto fail;<br>
&gt;     }<br>
&gt;<br>
&gt; First of all, can anyone explain exactly what the block about HP is<br>
&gt; really supposed to be doing? I can&#39;t honestly figure it out.<br>
&gt;<br>
&gt; But at any rate, I don&#39;t see how it could be correct. Particularly, this<br>
&gt; clause is always true (at most one of the comparisons will return 0), so<br>
&gt; why is it there?<br>
&gt;<br>
&gt;            (strncasecmp(make_model, &quot;HP&quot;, 2) ||<br>
&gt;             strncasecmp(make_model, &quot;Hewlett Packard&quot;, 15) ||<br>
&gt;             strncasecmp(make_model, &quot;Hewlett-Packard&quot;, 15))<br>
&gt;<br>
&gt; Seems like at a minimum, this block should be corrected to actually<br>
&gt; produce the status of &quot;is this an HP model.&quot; e.g., does the following<br>
&gt; diff make sense?<br>
&gt;<br>
&gt; === modified file &#39;utils/cups-browsed.c&#39;<br>
&gt; --- utils/cups-browsed.c      2016-02-10 14:18:28 +0000<br>
&gt; +++ utils/cups-browsed.c      2016-03-22 20:25:19 +0000<br>
&gt; @@ -2784,8 +2784,8 @@<br>
&gt;        ((!strcasestr(pdl, &quot;application/vnd.hp-PCL&quot;) &amp;&amp;<br>
&gt;          !strcasestr(pdl, &quot;application/PCL&quot;) &amp;&amp;<br>
&gt;          !strcasestr(pdl, &quot;application/x-pcl&quot;)) ||<br>
&gt; -       ((strncasecmp(make_model, &quot;HP&quot;, 2) ||<br>
&gt; -         strncasecmp(make_model, &quot;Hewlett Packard&quot;, 15) ||<br>
&gt; +       ((strncasecmp(make_model, &quot;HP&quot;, 2) &amp;&amp;<br>
&gt; +         strncasecmp(make_model, &quot;Hewlett Packard&quot;, 15) &amp;&amp;<br>
&gt;           strncasecmp(make_model, &quot;Hewlett-Packard&quot;, 15)) &amp;&amp;<br>
&gt;          !strcasestr(make_model, &quot;LaserJet&quot;) &amp;&amp;<br>
&gt;          !strcasestr(make_model, &quot;Mopier&quot;))) &amp;&amp;<br>
&gt;<br>
&gt; But I still don&#39;t feel like that&#39;s really what&#39;s intended, so an answer<br>
&gt; to my first question would be the most helpful.<br>
&gt;<br>
&gt; Now, besides the correctness of this logic, is this aspect of the daemon<br>
&gt; something that people regularly use? I see that it&#39;s installed on many<br>
&gt; Linux distributions, but it seems like it isn&#39;t really exercised for<br>
&gt; Bonjour/DNS-SD discovery unless someone modifies the default<br>
&gt; cups-browsed.conf to have &#39;CreateIPPPrinterQueues Yes&#39;.<br>
&gt;<br>
&gt; Regards,<br>
&gt; Brian<br>
_______________________________________________<br>
Printing-architecture mailing list<br>
<a href="mailto:Printing-architecture@lists.linux-foundation.org">Printing-architecture@lists.linux-foundation.org</a><br>
<a href="https://lists.linuxfoundation.org/mailman/listinfo/printing-architecture" rel="noreferrer" target="_blank">https://lists.linuxfoundation.org/mailman/listinfo/printing-architecture</a><br>
</div></div></blockquote></div><br></div>