<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>2021/02/06 on Yano&#39;s digital garage</title>
    <link>https://www.bravotouring.com/~yano/archives/2021/02/06/</link>
    <description>Recent content in 2021/02/06 on Yano&#39;s digital garage</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <lastBuildDate>Sat, 06 Feb 2021 11:48:17 +0900</lastBuildDate>
    <atom:link href="https://www.bravotouring.com/~yano/archives/2021/02/06/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>pngcntr改修</title>
      <link>https://www.bravotouring.com/~yano/diary/it/20210206_pngcntr.htm</link>
      <pubDate>Sat, 06 Feb 2021 11:48:17 +0900</pubDate>
      <guid>https://www.bravotouring.com/~yano/diary/it/20210206_pngcntr.htm</guid>
      <description>&lt;p&gt;&lt;a href=&#34;https://www.bravotouring.com/~yano/diary/it/20210124_ubuntu20.htm&#34;&gt;Ubuntu 20.04 (Focal Fossa)&lt;/a&gt;アップデートの残課題、&lt;span class=&#34;Software&#34;&gt;「CGIでも使えるPNG式画像カウンタ」&lt;/span&gt;(pngcntr)が&lt;span class=&#34;Warning&#34;&gt;動かない問題&lt;/span&gt;にようやく立ち向かうことに。&lt;/p&gt;&#xA;&lt;p&gt;まずはコマンドライン実行でもどこでコケているのかわかるように $err を X-PNGCNT-Error: で出力するようにしてみたところ、&lt;span class=&#34;Warning&#34;&gt;エラー -1&lt;/span&gt;を返すポイントが3箇所あった…orz&#xA;&lt;blockquote class=&#34;Log&#34;&gt;&#xA;&lt;span class=&#34;Strong&#34;&gt;yano@vps:/usr/lib/cgi-bin/pngcnt$ diff -bc ct_20161115.cgi ct_20210206.cgi&lt;/span&gt;&lt;br/&gt;&#xA;*** ct_20161115.cgi     2016-11-15 10:53:50.382253440 +0900&lt;br/&gt;&#xA;--- ct_20210206.cgi     2021-02-06 11:01:00.000000000 +0900&lt;br/&gt;&#xA;***************&lt;br/&gt;&#xA;*** 233,238 ****&lt;br/&gt;&#xA;--- 233,239 ----&lt;br/&gt;&#xA;  {&lt;br/&gt;&#xA;        my($err) = @_;&lt;br/&gt;&#xA;&lt;br/&gt;&#xA;+       print &#34;X-PNGCNT-Error: $err \n&#34;;&lt;br/&gt;&#xA;        $err = 4 if($err &gt;= 100);&lt;br/&gt;&#xA;&lt;br/&gt;&#xA;        print &#34;Content-Type: image/png\n\n&#34;;&lt;br/&gt;&#xA;***************&lt;br/&gt;&#xA;*** 558,569 ****&lt;br/&gt;&#xA;                        }&lt;br/&gt;&#xA;                        else&lt;br/&gt;&#xA;                        {&lt;br/&gt;&#xA;!                               return &amp;Error(-1);&lt;br/&gt;&#xA;                        }&lt;br/&gt;&#xA;                }&lt;br/&gt;&#xA;                else&lt;br/&gt;&#xA;                {&lt;br/&gt;&#xA;!                       return &amp;Error(-1);&lt;br/&gt;&#xA;                }&lt;br/&gt;&#xA;        }&lt;br/&gt;&#xA;        else    # ログファイルが読み込めず。&lt;br/&gt;&#xA;--- 559,570 ----&lt;br/&gt;&#xA;                        }&lt;br/&gt;&#xA;                        else&lt;br/&gt;&#xA;                        {&lt;br/&gt;&#xA;!                               return &amp;Error(-3);&lt;br/&gt;&#xA;                        }&lt;br/&gt;&#xA;                }&lt;br/&gt;&#xA;                else&lt;br/&gt;&#xA;                {&lt;br/&gt;&#xA;!                       return &amp;Error(-2);&lt;br/&gt;&#xA;                }&lt;br/&gt;&#xA;        }&lt;br/&gt;&#xA;        else    # ログファイルが読み込めず。&lt;br/&gt;&#xA;&lt;span class=&#34;Strong&#34;&gt;yano@vps:/usr/lib/cgi-bin/pngcnt$ ./ct_20210206.cgi&lt;/span&gt;&lt;br/&gt;&#xA;Set-Cookie: =1; expires=Sat, 06 Feb 2021 02:10:12 GMT;&lt;br/&gt;&#xA;X-PNGCNT-Error: &lt;span class=&#34;Warning&#34;&gt;-1&lt;/span&gt;&lt;br/&gt;&#xA;Content-Type: image/png&lt;br/&gt;&#xA;&lt;br/&gt;&#xA;        PNG&lt;br/&gt;&#xA;～～&lt;br/&gt;&#xA;&lt;span class=&#34;Strong&#34;&gt;yano@vps:/usr/lib/cgi-bin/pngcnt$&lt;/span&gt;&lt;/blockquote&gt;&#xA;というわけで、エラー&lt;span class=&#34;Warning&#34;&gt;-1&lt;/span&gt;を返すポイントが require の部分と判明。&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
